package com.Serializable;

import java.io.*;

/**
 * @description: 读取
 * @author: 刘建楼
 * @create: 2021-04-10
 **/
public class ReadObject {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileInputStream inputStream = new FileInputStream("object.txt");
        ObjectInputStream outputStream = new ObjectInputStream(inputStream);
        Person person = (Person) outputStream.readObject();
        System.out.println(person.getName());
        System.out.println(person.getAge());
    }
}
